<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>CTF Intro</title>

		<link rel="stylesheet" href="css/reveal.css">
        <style>
            .reveal .slides { font-size:80%; }

            .line { display: block; }
            .line.focus { background: #fdf6e3; color: #657b83; }
        </style>
		<link rel="stylesheet" href="css/theme/black.css">

		<!-- Theme used for syntax highlighting of code -->
		<link rel="stylesheet" href="lib/css/atom-one-dark.css">

		<!-- Printing and PDF exports -->
		<script>
			var link = document.createElement( 'link' );
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
			document.getElementsByTagName( 'head' )[0].appendChild( link );
		</script>
	</head>
	<body>
		<div class="reveal">
			<div class="slides">
                <section data-markdown="markdown/intro.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/misc.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/crypto.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/web.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/re.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/pwn.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/mobile.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                <section data-markdown="markdown/outro.md"
                    data-separator-vertical="^\r?\n\r?\n">
                </section>
                </script>
			</div>
		</div>

		<script src="lib/js/head.min.js"></script>
		<script src="js/reveal.js"></script>

		<script>
			// More info about config & dependencies:
			// - https://github.com/hakimel/reveal.js#configuration
			// - https://github.com/hakimel/reveal.js#dependencies
			Reveal.initialize({
				dependencies: [
					{ src: 'plugin/markdown/marked.js' },
                    { src: 'plugin/markdown/markdown.js' },
                    { src: 'plugin/notes/notes.js', async: true },
                    { src: 'plugin/highlight.js/highlight.pack.js' },
                    { src: 'plugin/zoom-js/zoom.js', async: true },
                    { src: 'plugin/reveal-code-focus/reveal-code-focus.js', callback: function() { RevealCodeFocus(); } }
				]
			});
            Reveal.configure({
                slideNumber: "c/t",
            });
            Reveal.addEventListener( 'ready', function( event ) {
                document.querySelectorAll('ul > li').forEach(function(li) {
                    li.className = "fragment fade-in"
                });
            } );

            Reveal.addEventListener( 'fragmentshown', function( event ) {
                if (event.fragment.getAttribute("class").split(" ")[1] != "fade-over") {
                    return;
                }
                parent = event.fragment.parentNode.querySelectorAll( '.fragment' );
                prev = null;

                console.log("start loop\n");
                for (i = 0; i < parent.length; i++ ) {
                    if (event.fragment == parent[i]) {
                        console.log("found\n")
                        console.log(prev);
                        break;
                    }
                    prev = parent[i];
                }
                console.log("finish loop\n");
                prev.setAttribute("style", "display: none;");

            } );

            Reveal.addEventListener( 'fragmenthidden', function( event ) {
                if (event.fragment.getAttribute("class").split(" ")[1] != "fade-over") {
                    return;
                }
                parent = event.fragment.parentNode.querySelectorAll( '.fragment' );
                prev = null;

                console.log("start loop\n");
                for (i = 0; i < parent.length; i++ ) {
                    if (event.fragment == parent[i]) {
                        console.log("found\n")
                        console.log(prev);
                        break;
                    }
                    prev = parent[i];
                }
                console.log("finish loop\n");
                prev.setAttribute("style", "display: inherit;");

            } );

		</script>
	</body>
</html>
